#!/bin/sh


workdir=""

if [ ! -e allman.md ]; then 
	echo "没有allman.md文件，请检查目录"
	exit -1
fi

file=allman.md

if [ $# -lt 1 ];then 
	echo "Usage： $0 name of man"
	exit -1
fi

for arg in "$@"
do
	grep -w $arg $workdir$file >/dev/null

	if [ $? -eq 0 ];then
		echo $arg "already exist"
	else
		echo $arg >>$workdir$file
	fi
done


